package com.banyuan.HomeWork.classrelated.two;

public class Vehicle {
    private int speed;
    private int size;

    public Vehicle() {
    }

    public Vehicle(int speed, int size) {
        this.speed = speed;
        this.size = size;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public void move() {
        System.out.println("该交通工具正以时速每小时" + this.speed + "公里的速度正在行使。");
    }

    public void speedUp(int i) {
        this.speed += i;
        System.out.println("该交通工具的时速提升了" + i + "km/h;");
        System.out.println("该交通工具当前时速为" + this.speed + "km/h;");
    }

    public void speedDown(int i) {
        this.speed -= i;
        System.out.println("该交通工具的时速减少了" + i + "km/h;");
        System.out.println("该交通工具当前时速为" + this.speed + "km/h;");
    }
}
